import CodeEnum from './CodeEnum.js';
export default class Result {
    constructor(data, message = 'success', code = CodeEnum.SUCCESS) {
        this.data = data;
        this.message = message;
        this.code = code;
    }
    static success(data, message = 'success', code = CodeEnum.SUCCESS) {
        return new Result(data, message, code);
    }
    static error(message = 'fail', code = CodeEnum.ERROR) {
        return new Result(null, message, code);
    }
}